package com.boonya.jorm.entity;

import org.javaclub.jorm.annotation.Column;
import org.javaclub.jorm.annotation.Entity;
import org.javaclub.jorm.annotation.Id;
import org.javaclub.jorm.annotation.NoColumn;
import org.javaclub.jorm.annotation.PK;
/**
 * 
 * <li>文件名称: User</li>
 * <li>文件描述: $</li>
 * <li>内容摘要: 包括模块、函数及其功能的说明</li>
 * <li>完成日期：2013-10-27</li>
 * <li>所属作者：boonyachengdu@gmail.com</li>
 * <li>修改记录1：下午04:51:57,修改内容描述</li>
 *
 */
@PK(value = "id")
@Entity(table="t_user")
public class User {
    
    @Id
    @Column("id")
    private int id;

    @Column("name")
    private String name;
        
    // 与数据库字段命名一致，可以不指定@Column
    private String sex;

    @Column("age")
    private Integer age;

    @Column("career")
    private String career;
    
    @NoColumn
    private int kvalue;
    
    public User() {
        super();
    }

    public User(String name, String sex, Integer age, String career) {
        super();
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.career = career;
    }

    public User(Integer id, String name, String sex, Integer age, String career) {
        super();
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.career = career;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getCareer() {
        return career;
    }

    public void setCareer(String career) {
        this.career = career;
    }

    public int getKvalue() {
        return kvalue;
    }

    public void setKvalue(int kvalue) {
        this.kvalue = kvalue;
    }

    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("[" + id + ", " + name + ", " + sex + ", " + age + ", " + career + "]");
        return sb.toString();
    }

}
